//
//  TableViewCellFactory.m
//  B段_开眼
//
//  Created by hu on 16/4/21.
//  Copyright © 2016年 Howie. All rights reserved.
//

#import "TableViewCellFactory.h"

@implementation TableViewCellFactory


+ (TableViewCellFactory *)cellWithTableView:(UITableView *)tableView identifier:(NSString *)identifier model:(id)model
{
    NSString *modelName = NSStringFromClass([model class]);
    modelName = [modelName substringToIndex:modelName.length - 5];
    Class cel = NSClassFromString(modelName);
    TableViewCellFactory *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (cell == nil) {
        cell = [[[cel class] alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
    }
    [cell setDataWithModel:model];
    return cell;
}

- (void)setDataWithModel:(id)model
{
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
